//
//  FeedbackCell.m
//  CoachsBook
//
//  Created by huiyong li on 2022/8/31.
//

#import "FeedbackCell.h"

@interface FeedbackCell()
@property(nonatomic,strong) UIView *bjview;
@property(nonatomic,strong) UIImageView *iconImage;
@property(nonatomic,strong) UILabel *titleLabel;
@property(nonatomic,strong) UILabel *typeLabel;
@property(nonatomic,strong) UILabel *contentLabel;
@property(nonatomic,strong) UILabel *timeLabel;

@end
@implementation FeedbackCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
        self.contentView.backgroundColor = rgba(255, 255, 255, 1);
    }
    return self;
}

- (void)setupUI
{
    self.bjview = [[UIView alloc]initWithFrame:CGRectMake(16, 0, APPwidth-32, 145)];
    self.bjview.layer.cornerRadius = 10;
    self.bjview.layer.masksToBounds = YES;
    [self.contentView addSubview:self.bjview];
    
    
    
    self.iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(APPwidth-32-80, 0, 80, 70)];
    [self.bjview addSubview:self.iconImage];
    
    
    
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 15, APPwidth-32-95, 20)];
    self.titleLabel.textColor = rgba(51, 51, 51, 1);
    self.titleLabel.font = kPingFangRegular(16);
    [self.bjview addSubview:self.titleLabel];
    
    self.typeLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 15+20+12, APPwidth-32-95, 20)];
    self.typeLabel.textColor = rgba(51, 51, 51, 1);
    self.typeLabel.font = kPingFangRegular(16);
    [self.bjview addSubview:self.typeLabel];
    
    self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 15+32+32, APPwidth-32-30, 20)];
    self.contentLabel.textColor = rgba(51, 51, 51, 1);
    self.contentLabel.font = kPingFangRegular(16);
    [self.bjview addSubview:self.contentLabel];
    
    
    self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 15+32+32+32, APPwidth-32-30, 20)];
    self.timeLabel.textColor = rgba(153, 153, 153, 1);
    self.timeLabel.font = kPingFangRegular(14);
    [self.bjview addSubview:self.timeLabel];
    
    
    
}




-(void)cellFillWithModel:(FeedbackModel *)model
{
    
    if (model.Feedbackstate == 0) {
        self.bjview.backgroundColor = rgba(255, 246, 237, 1);
        self.iconImage.image = CoachsBookImageName(@"待回复");
    }
    else if (model.Feedbackstate == 1)
    {
        self.bjview.backgroundColor = rgba(235, 245, 253, 1);
        self.iconImage.image = CoachsBookImageName(@"已回复");
        
    }
    else{
        self.bjview.backgroundColor = rgba(230, 250, 245, 1);
        self.iconImage.image = CoachsBookImageName(@"已结束");
    }
    self.titleLabel.text = [NSString stringWithFormat:@"反馈标题:%@",@"近期使用感受"];
    self.typeLabel.text = [NSString stringWithFormat:@"反馈类型:%@",@"程序BUG"];
    self.contentLabel.text = [NSString stringWithFormat:@"反馈内容:%@",@"最后在啰嗦一句，小编从来不会用个硬..."];
    self.timeLabel.text = [NSString stringWithFormat:@"%@  %@",@"2022-08-23",@"10:21"];
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
